package net.minecraft.src;

public class ModelSwampMonster extends ModelBase
{

	ModelRenderer Top_Head;
	ModelRenderer Bottom_Head;
	ModelRenderer Upper_body;
	ModelRenderer Main_body;
	ModelRenderer Right_leg;
	ModelRenderer Left_Leg;
	ModelRenderer Lower_body_1;
	ModelRenderer Lower_body_2;
	ModelRenderer Lower_body_3;
	ModelRenderer Tail_seg_1;
	ModelRenderer Tail_seg_2;
	ModelRenderer Tail_seg_3;
	ModelRenderer Tail_seg_4;
	ModelRenderer Mouth_area;
	
	int[][] animationDataPosX = {
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	};
	
	int[][] animationDataPosY = {
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	};
	
	int[][] animationDataAngle = {
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
			{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	};

	public ModelSwampMonster()
	{
		Top_Head = new ModelRenderer(this, 0, 22);
        Top_Head.addBox(0F, 0F, 0F, 10, 5, 5);
        Top_Head.setRotationPoint(9F, 10F, -2F);
        Top_Head.setTextureSize(64, 32);
        setRotation(Top_Head, 0F, 0F, 0F);
        Bottom_Head = new ModelRenderer(this, 18, 19);
        Bottom_Head.addBox(0F, 2F, 0F, 10, 4, 5);
        Bottom_Head.setRotationPoint(8F, 13F, -2.3F);
        Bottom_Head.setTextureSize(64, 32);
        setRotation(Bottom_Head, 0F, 0F, 0F);
        Upper_body = new ModelRenderer(this, 28, 0);
        Upper_body.addBox(0F, 0F, 0F, 11, 9, 7);
        Upper_body.setRotationPoint(-2F, 10F, -3F);
        Upper_body.setTextureSize(64, 32);
        setRotation(Upper_body, 0F, 0F, 0F);
        Main_body = new ModelRenderer(this, 14, 0);
        Main_body.addBox(0F, 0F, 0F, 16, 10, 9);
        Main_body.setRotationPoint(-17F, 9.533334F, -4F);
        Main_body.setTextureSize(64, 32);
        setRotation(Main_body, 0F, 0F, 0F);
        Right_leg = new ModelRenderer(this, 0, 0);
        Right_leg.addBox(0F, 0F, 0F, 3, 1, 1);
        Right_leg.setRotationPoint(4F, 17F, -4F);
        Right_leg.setTextureSize(64, 32);
        setRotation(Right_leg, 0F, 0F, 0F);
        Left_Leg = new ModelRenderer(this, 0, 0);
        Left_Leg.addBox(0F, 0F, 0F, 3, 1, 1);
        Left_Leg.setRotationPoint(4F, 17F, 4F);
        Left_Leg.setTextureSize(64, 32);
        setRotation(Left_Leg, 0F, 0F, 0F);
        Lower_body_1 = new ModelRenderer(this, 30, 0);
        Lower_body_1.addBox(0F, 0F, 0F, 12, 2, 5);
        Lower_body_1.setRotationPoint(-28.5F, 13F, -2F);
        Lower_body_1.setTextureSize(64, 32);
        setRotation(Lower_body_1, 0F, 0F, 0F);
        Lower_body_2 = new ModelRenderer(this, 30, 0);
        Lower_body_2.addBox(0F, 0F, 0F, 12, 2, 5);
        Lower_body_2.setRotationPoint(-28.5F, 13F, -2F);
        Lower_body_2.setTextureSize(64, 32);
        setRotation(Lower_body_2, 0F, 0F, 0F);
        Lower_body_3 = new ModelRenderer(this, 44, 0);
        Lower_body_3.addBox(0F, 0F, 0F, 5, 2, 5);
        Lower_body_3.setRotationPoint(-21.53333F, 13F, -2F);
        Lower_body_3.setTextureSize(64, 32);
        setRotation(Lower_body_3, 0F, 0F, 0F);
        Tail_seg_1 = new ModelRenderer(this, 56, 0);
        Tail_seg_1.addBox(0F, 0F, 0F, 3, 2, 1);
        Tail_seg_1.setRotationPoint(-28.5F, 13F, 1F);
        Tail_seg_1.setTextureSize(64, 32);
        setRotation(Tail_seg_1, 0F, 3F, 0F);
        Tail_seg_2 = new ModelRenderer(this, 54, 0);
        Tail_seg_2.addBox(0F, 0F, 0F, 4, 2, 1);
        Tail_seg_2.setRotationPoint(-31F, 13F, 1F);
        Tail_seg_2.setTextureSize(64, 32);
        setRotation(Tail_seg_2, 0F, -2F, 0F);
        Tail_seg_3 = new ModelRenderer(this, 52, 0);
        Tail_seg_3.addBox(0F, 0F, 0F, 5, 2, 1);
        Tail_seg_3.setRotationPoint(-34F, 13F, 3.4F);
		Tail_seg_3.setTextureSize(64, 32);
        setRotation(Tail_seg_3, 0F, -2F, 0F);
        Tail_seg_4 = new ModelRenderer(this, 0, 18);
        Tail_seg_4.addBox(0F, 0F, 0F, 8, 3, 1);
        Tail_seg_4.setRotationPoint(-36.5F, 12.5F, 7F);
        Tail_seg_4.setTextureSize(64, 32);
        setRotation(Tail_seg_4, 0F, -2F, 0F);
        Mouth_area = new ModelRenderer(this, 44, 21);
        Mouth_area.addBox(0F, 0F, 0F, 3, 6, 5);
        Mouth_area.setRotationPoint(18F, 11.5F, -2F);
        Mouth_area.setTextureSize(64, 32);
        setRotation(Mouth_area, 0F, 0F, 0F);
	}

	public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
	{
		super.render(entity, f, f1, f2, f3, f4, f5);
		setRotationAngles(f, f1, f2, f3, f4, f5);
		Top_Head.render(f5);
		Bottom_Head.render(f5);
		Upper_body.render(f5);
		Main_body.render(f5);
		Right_leg.render(f5);
		Left_Leg.render(f5);
		Lower_body_1.render(f5);
		Lower_body_2.render(f5);
		Lower_body_3.render(f5);
		Tail_seg_1.render(f5);
		Tail_seg_2.render(f5);
		Tail_seg_3.render(f5);
		Tail_seg_4.render(f5);
		Mouth_area.render(f5);
	}
	
	public void setLivingAnimations(EntityLiving entityliving, float f, float f1, float f2)
	{
		EntitySwampMonster sm = (EntitySwampMonster)entityliving;
		
		float rate = 0.02F;
		
		if(sm.isMoving())
		{
			if(sm.animationFootsUpward)
			{
				if(sm.animationFoots++ > 5)
					sm.animationFootsUpward = false;
			}
			else
			{
				if(sm.animationFoots -- < -5)
					sm.animationFootsUpward = true;
			}
			if(sm.animationTailSide)
			{
				if(sm.animationTail++ > 30)
					sm.animationTailSide = false;
			}
			else
			{
				if(sm.animationTail-- < -15)
					sm.animationTailSide = true;
			}
		}
		
		Left_Leg.rotateAngleZ = (sm.animationFoots * 0.1F);
		Right_leg.rotateAngleZ = -Left_Leg.rotateAngleZ;
		
		Tail_seg_1.rotateAngleY = -28.5F + (sm.animationTail * (1.5F * rate));
		
		Tail_seg_2.rotationPointZ = sm.animationTail * (5F * rate);
		Tail_seg_2.rotateAngleY = 10F + (sm.animationTail * (2.2F * rate));
		
		Tail_seg_3.rotationPointZ = 2F + (sm.animationTail * (10.0F * rate));
		Tail_seg_3.rotationPointX = -34F + (sm.animationTail * (4F * rate));
		Tail_seg_3.rotateAngleY = 10.75F + (sm.animationTail * (2.5F * rate));
		
		Tail_seg_4.rotationPointZ = 6F + (sm.animationTail * (10F * rate));
		Tail_seg_4.rotationPointX = -36F + (sm.animationTail * (15F * rate));
		Tail_seg_4.rotateAngleY = 11.5F + (sm.animationTail * (2F * rate));
	}

	public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
	{
		super.setRotationAngles(f, f1, f2, f3, f4, f5);
	}

	private void setRotation(ModelRenderer model, float x, float y, float z)
	{
		model.rotateAngleX = x;
		model.rotateAngleY = y;
		model.rotateAngleZ = z;
	}
}